//
// Created by ASUS on 2024/5/20/星期一.
//
#include <bits/stdc++.h>
using namespace std;

vector<bool> canMakePaliQueries(string s, vector<vector<int>>& queries) {
	int n = s.length();
	vector<int> sum(n + 1);
	for (int i = 0; i < n; i++) {
		sum[i + 1] = sum[i] ^ (1 << (s[i] - 'a'));
	}
	int m = queries.size();
	vector<bool> ans(m);
	for (int i = 0; i < m; i++) {
		auto& q = queries[i];
		int l = q[0], r = q[1], k = q[2];
		if (__builtin_popcount(sum[r + 1] ^ sum[l]) <= 2 * k + 1)
			ans[i] = true;
	}
	return ans;
}